#version 120

uniform vec4 scale;
uniform vec4 translate;
uniform vec2 stmul;
uniform vec2 st1offset;
uniform vec2 st2offset;

attribute vec4 position;

mat4 ortho = mat4( 

	2.0 / 800.0, 0.0, 0.0, 0.0,
	0.0, -2.0 / 600.0, 0.0, 0.0,
	0.0, 0.0, 1.0, 0.0,
	-1.0, 1.0, 0.0, 1.0 

);

mat4 modelview = mat4(

	1.0, 0.0, 0.0, 0.0,
	0.0, 1.0, 0.0, 0.0,
	0.0, 0.0, 1.0, 0.0,
	1.0, 1.0, 1.0, 1.0

);


varying vec2 texcoord;

void main()
{

	modelview[3].xyz = translate.xyz;
	
	modelview[0][0] = scale.x;
	modelview[1][1] = scale.y;
	modelview[2][2] = scale.z;
	
	gl_Position = ortho * modelview * position;
	texcoord = position.xy * stmul;
	
}
